Hệ thống quản lý ISP trong PHP
1 +<?php include 'includes/header.php'; ?>
2 <?php
3 require_once "includes/classes/admin-class.php";
4 $admins = new Admins($dbh);
5 if(isset($_POST['from'])){
6 //$date = $_POST['date'];
7 $amount = $_POST['amount'];
8 $from = $_POST['from'];
9 $remarks = $_POST['remarks'];
10 if(!$admins->colleciton($amount, $from, $remarks)){
11 echo "Something went wrong ! Try again later.";
12 }else{
13 echo "Expanse added !";
14 }
15 }
16
17
18
19
20 ?>
21 <div class="dashboard">
22 <div class="col-md-12 col-sm-12">
23 <div class="col-md-9">
24 <h3><a href="daily_data.php" class="btn btn-sm btn-primary"> Back</a> Expanse History</h3>
25 </div>
26 <div class="col-md-3 pull-right">
27 <form class="form-inline pull-right">
28 <div class="form-group">
29 <label class="sr-only" for="search">Search for</label>
30 <div class="input-group">
31 <div class="input-group-addon"><span class="glyphicon glyphicon-search" aria-hidden="true"></span></div>
32 <input type="text" class="form-control" id="search" placeholder="Type a name">
33 <div class="input-group-addon"></div>
34 </div>
35 </div>
36 <!-- <button type="submit" class="btn btn-info">Search</button> -->
37 </form>
38 </div>
39 <hr>
40 <div class="col-md-12 col-sm-12">
41 <table class="table center table-striped table-bordered" id="grid-basic">
42 <thead class="thead-inverse">
43 <tr class="info">
44 <th>ID </th>
45 <th>Date</th>
46 <th>Amount</th>
47 <th>From</th>
48 <th>Remarks</th>
49 <th>Action</th>
50 </tr>
51 </thead>
52 <tbody>
53 <?php
54 $collection = $admins->fetchCollectin();
55 if (isset($collection) && sizeof($collection) > 0){
56 foreach($collection as $collect) {
57 ?>
58 <tr>
59 <td><?=$collect->id?></td>
60 <td class="search"><?=date("j F y",strtotime($collect->created_at))?></td>
61 <td class="search"><?=$collect->amount?></td>
62 <td class="search"><?=$collect->payee?></td>
63 <td class="search"><?=$collect->remarks?></td>
64 <td><button type="button" data-id="<?=$collect->id?>" class="btn btn-danger btn-sm delete disabled">DELETE</button></td>
65 </tr>
66 <?php }} ?>
67 </tbody>
68 </table>
69 </div>
70 </div>
71 <?php include 'includes/footer.php'; ?>
72 <script type="text/javascript">
73 document.getElementById('date').valueAsDate = new Date();
74 </script>
75 <script type="text/javascript">
76 $(function() {
77 grid = $('#grid-basic');
78
79 // handle search fields of members key up event
80 $('#search').keyup(function(e) {
81 text = $(this).val(); // grab search term
82
83 if(text.length > 1) {
84 grid.find('tr:has(td)').hide(); // hide data rows, leave header row showing
85
86 // iterate through all grid rows
87 grid.find('tr').each(function(i) {
88 // check to see if search term matches Name column
89 if($(this).find('.search').text().toUpperCase().match(text.toUpperCase()))
90 $(this).show(); // show matching row
91 });
92 }
93 else
94 grid.find('tr').show(); // if no matching name is found, show all rows
95 });
96
97 });
98 </script>